package com.cloud.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;

/**
 * @Author: TongRui乀
 * @Date: 2019/10/29 9:37
 * @description：
 */
@Slf4j
@EnableBinding(Sink.class)
public class RabbitConsumer {


    @StreamListener(target = Sink.INPUT, condition = "headers['type']== 'dog'")
    public void handleDog(String message){
        log.info("dogStreamListener received:[{}]", message);
    }


    @StreamListener(target = Sink.INPUT, condition = "headers['type']== 'cat'")
    public void handleCat(String message){
        log.info("catStreamListener received:[{}]", message);
    }


}
